//
//  AuthorsTableViewController.m
//  Library
//
//  Created by Johnnie Walker on 07/10/2008.
//  Copyright 2008 Random Sequence. All rights reserved.
//

#import "AuthorsTableViewController.h"
#import "RSDB.h"

@implementation AuthorsTableViewController

- (void)reloadItems;
{
	self.items = [[[RSDB getTable:@"author"] findAll] mutableCopy];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"AuthorsTableCell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }
    // Configure the cell
	cell.text = [[items objectAtIndex:indexPath.row] getProperty:@"name"];
	
    return cell;
}

@end

